<!DOCTYPE html>
<html>
    <head>
		<meta charset="utf-8" />
		<title>初期配置-插入测试数据-随机往来单位</title>
		<script src="/accHestia/lib/jqgrid/js/jquery.min.js"></script>
        <script src= "/accHestia/src/view/js/rpc.js"></script>
        <script>
            $(document).ready(function() {
                $("#id_btn_gc_add_company").click(function() {
                    call_rpc("test_add_gened_compay", {}, add_gened_compay_cb);
                });
                $("#id_btn_gc_change").click(function() {
                    call_rpc("test_autogen_company", {genCount:100}, autogen_company_cb);
                }).click();                
            });
            
            function autogen_company_cb(ps_data) {
                if ("OK" == ps_data["result"]) {
                    $("#gen_result_container").html(ps_data["hData"]);
                } else {
                    alert(ps_data["err_msg_display"] || "Internal Error!");
                }
            }
            
            function add_gened_compay_cb(ps_data) {
                if ("OK" == ps_data["result"]) {
                    alert("执行成功.\n" + ps_data["ok_count"] + "条往来单位数据被更新到数据库.");
                    window.location.href = "/accHestia/src/view/feature/init/genPrj.php";
                } else {
                    alert(ps_data["err_msg_display"] || "Internal Error!");
                }
            }
            
        </script>
        <style>
        table {
            border:1px solid rgb(0, 0, 0);
        }
        th {
            background-color:#A7C942;
        }
        td {
            /*border:1px solid #98bf21;*/
        }
        tr.acc_ood_row td {
            /*border:1px solid #98bf21;*/
            background-color:#EAF2D3
        }
        </style>
    </head>
	<body>
        <div id="gen_result_container"></div>
        <div class="acc_clear"></div>
        <div style="padding-top:20px">
            <input type="button" id="id_btn_gc_change" value="换一换">
            <input type="button" id="id_btn_gc_add_company" value="添加以上随机往来单位">
        </div>
	</body>
</html>
